package com.idroc.coelacanth.core.storage.support;

import com.idroc.coelacanth.core.storage.Record;
import com.idroc.coelacanth.core.storage.StorageKey;
import com.idroc.coelacanth.core.storage.StorageValue;

/**
 * 字符串数据库记录
 * @author yuyoo (yuyoo4j@163.com)
 * @date 2009-12-15 上午10:04:09
 */
public class StringRecord implements Record {
	
	private String k = null;
	private String v = null;
	
	public StringRecord(String key, String value) {
		
		k = key;
		v = value;
	}
	
	public StringRecord() {
		
		k = "";
		v = "";
	}

	public StorageKey getKey() { 
		
		return KeyValues.newStringKey(k);
	}

	public StorageValue getValue() { 
		
		return KeyValues.newByteArrayValue(v);
	}
	
	public void setKey(String key) {
		k = key;
	}

	public void setValue(String value) {
		v = value;
	}

	public void setKey(StorageKey key) {
		
		k = new String(key.getBytes());
	}

	public void setValue(StorageValue value) {

		v = new String(value.getBytes());
	}
}
